home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Blitz2 / BlitzFaq / FaqLists / Listviewex.txt < prev    next >
Encoding:
Text File  |  1996-09-05  |  2.4 KB  |  61 lines

  1. ;*********************************************** ;          GUI source created with:
  2. ;         Blitz 2 GUI Generator V1.7
  3. ;  (C) Copyright 1993-1995 Creative Software. ;
  4. ;           Registered To: Simon Archer           ;                User Number
  5. : 1                 ;
  6. ;               GUI Designed By:
  7. ;                 Simon Archer                   ;
  8. ;    Converted from a GUI file created using ;  GadToolsBox V2.0. The ultimate GUI Creator! 
  9. ;*********************************************** ; 
  10. WBStartup ; start from Workbench
  11. NoCli ; no default CLI
  12. ;
  13. .InitialiseVars
  14. ;
  15. Project0Wnd = 0
  16. Project0GList = 0 ; This represents the gadgetlist number. Change to suit
  17. Project0Scr = 0 ; This represents the screen number. Change to suit ;
  18. FindScreen Project0Scr
  19. ;Lets grab the screen's structure...
  20. *scr.Screen = Peek.l(Addr Screen(Project0Scr)) ;
  21. ; Load the font to use with this GUI...
  22. Project0Font$ = "topaz.font"
  23. Project0FontSize = 8
  24. LoadFont 1,Project0Font$,Project0FontSize : Use IntuiFont 1 ;
  25. ; This is the NEWTYPE variable for the list used by the ListView gadget
  26. NEWTYPE .listview
  27.     pad.w ; This is a limitation of Blitz 2
  28.     string.s
  29. End NEWTYPE
  30. ;
  31. ;Fill the TextAttr structure
  32. Project0FontAttr.TextAttr\ta_Name = &Project0Font$,Project0FontSize,0,0 ;
  33. ;This sets font sensitivity for the screen.. *scr\Font\ta_Name =
  34. Project0FontAttr\ta_Name ;
  35. Dim List Project0ListV0.listview(4)
  36. ;This list is used by your listview gadget. ;
  37. If AddItem(Project0ListV0()) Then Project0ListV0()\pad = 13,"My First Item" If
  38. AddItem(Project0ListV0()) Then Project0ListV0()\pad = 14,"My Second Item" If
  39. AddItem(Project0ListV0()) Then Project0ListV0()\pad = 13,"My Third Item" If
  40. AddItem(Project0ListV0()) Then Project0ListV0()\pad = 12,"My Last Item" GTTags
  41. #GTLV_ShowSelected,0
  42. GTListView windonum,50,5,3,413,88,"",$0,Project0ListV0.listview(),0,0 ;
  43. ; Define the window...
  44. AddIDCMP $024C077E ; set the IDCMP tags for window Window
  45. windonum,95,55,431,109,$20100E,"ListView Test",0,1 ;
  46. AttachGTList windonum,windonum
  47. ;
  48. ;
  49. .MainEventHandler
  50. ;
  51. Repeat
  52.     ev.l = WaitEvent ; wait for IDCMP event
  53.     k$ = Inkey$ ; store key press, if any.
  54.     If ev = $40 AND EventWindow = windonum ; gadget been hit
  55.         If GadgetHit = 50 ; Action for ListViewGad here
  56.         EndIf
  57.     EndIf
  58.     If k$ = Chr$(27) Then Goto _quit ; this allows us to break out! Until ev =
  59. $200 Then Goto _quit ; close gadget ;
  60. ._quit ; this can be used to build custom exit End ; quit now!
  61.